package com.studies.pc.controller.wx;


import com.studies.pc.query.ActivityEnrollQuery;
import com.studies.pc.query.ActivityQuery;
import com.studies.pc.service.ActivityEnrollService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 研学报名 前端控制器
 * </p>
 *
 * @author 研学活动后台
 * @since 2019-12-24
 */
@Api(tags="研学活动报名接口wx端")
@CrossOrigin //跨域
@RestController
@RequestMapping("/wx/enroll/")
public class ActivityEnrollWxController {
    @Autowired
    private ActivityEnrollService activityEnrollService;
    @ApiOperation(value = "单个报名")
    @PostMapping(value = "enroll")
    public Object enroll(@ApiParam(name = "activityEnrollQuery", value = "条件", required = false)
                                     ActivityEnrollQuery activityEnrollQuery){
        Integer enroll = activityEnrollService.enroll(activityEnrollQuery);
        return enroll;
    }

    @ApiOperation(value = "查询报名状态")
    @PostMapping(value = "enrollName")
    public Object enrollName(@ApiParam(name = "activityEnrollQuery", value = "条件", required = false)
                                 ActivityEnrollQuery activityEnrollQuery){
        Boolean aBoolean = activityEnrollService.enrollName(activityEnrollQuery);
        return aBoolean;
    }
}

